<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>主页面</title>
</head>
<body>
<h2>添加投诉页面</h2>
<div>
    <form method="post" th:action="@{/save}" action="/save">
        <table>
            <tr>
                <td>投诉匹配:</td>
                <td>
                    <select name="brandId" id="brandId">
                        <option value="">--请选择--</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>投诉问题:</td>
                <td>
                    <input type="text" name="problem" id="problem">
                </td>
            </tr>
            <tr>
                <td>投诉车系:</td>
                <td>
                    <input type="text" name="carType" id="carType">
                </td>
            </tr>
            <tr>
                <td>投诉时间:</td>
                <td>
                    <input type="text" name="complaintsTime" id="complaintsTime">yyyy-MM-dd
                </td>
            </tr>
            <tr>
                <td>投诉状态:</td>
                <td>
                    <input type="radio" name="status" value="0" th:value="0" checked>信息审核
                    <input type="radio" name="status" value="1" th:value="1">厂家受理
                </td>
            </tr>
            <tr>
                <td>相关操作:</td>
                <td>
                    <input type="submit" id="submit" value="新增">
                    <input type="button" id="fh" value="返回">
                </td>
            </tr>
        </table>
    </form>
</div>
</body>
<script th:src="@{js/jquery.js}" src="js/jquery.js"></script>
<script>
    // 下拉框查询
    $(function () {
        $.getJSON("/findAllBrand",function (data) {
            $.each(data,function (index,ele) {
                let op=`<option value="${ele.brandId}">${ele.brandName}</option>`;
                $("#brandId").append(op);
            })
        })
    });

    // 返回
    $("#fh").click(function () {
        history.go(-1);
    })
</script>
</html>
